<?php

namespace app\mall\controller\api\goods;

use app\mall\enum\StatusEnum;
use app\mall\model\MallGoods;

/**
 * 商品分类
 * Class Search
 * @package app\mall\controller\api\goods
 */
class Search extends Base
{

    public function index()
    {
        $model = MallGoods::where('status', StatusEnum::VALID);
        $model->order('inx', 'DESC');
        $model->order('id', 'desc');
        $model->field([
            'id', 'title', 'ads_title', 'image',
            'price', 'price_origin', 'stock', 'sale_volume', 'praise_volume'
        ]);
        $list = $model->paginate();
        return json_return($list->items());
    }

}